page.tsx 944 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Metadata } from "next";
  2. import { getTranslations, setRequestLocale } from "next-intl/server";
  3. import DashboardContent from "./dashboard-content";
  4. import Navigation from "@/components/navigation";
  5. import Footer from "@/components/footer";
  6. interface DashboardPageProps {
  7. params: Promise<{
  8. locale: string;
  9. }>;
  10. }
  11. export async function generateMetadata({ params }: DashboardPageProps): Promise<Metadata> {
  12. const { locale } = await params;
  13. const t = await getTranslations({ locale, namespace: 'dashboard' });
  14. return {
  15. title: t('pageTitle'),
  16. };
  17. }
  18. export default async function DashboardPage({ params }: DashboardPageProps) {
  19. const { locale } = await params;
  20. // Enable static rendering
  21. setRequestLocale(locale);
  22. return (
  23. <>
  24. <Navigation locale={locale} />
  25. <main className="pt-16">
  26. <DashboardContent locale={locale} />
  27. </main>
  28. <Footer locale={locale} />
  29. </>
  30. );
  31. }